<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="com.ochnas.examples.jsf.service.RentABike" %>
<%@ page import="com.ochnas.examples.jsf.domain.Bike" %>
<%@ page import="com.ochnas.examples.jsf.service.ArrayListRentABike" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
   <head>
      <title>
         Edit Bike
      </title>
   </head>
   <body>
      <h1>Edit Bike</h1>
      <form method="POST" >
      	<spring:hasBindErrors name="commandName">
      		<b>Please fix all errors!</b>
      	</spring:hasBindErrors>
         <table border="1" cellspacing="2" cellpadding="2">
            <tr>
               <td align="right">Manufacturer:</td>
               <spring:bind path="commandName.manufacturer">
               <td>
               	 <input type="text" 
                  		 name="<c:out value='${status.expression}'/>"
                         value="<c:out value='${status.displayvalue}'/>"/>
               </td>
               <td>
                  	<c:if test="${status.error}">
                  		<div class="error">
                  			<font color="red">
                  			<c:forEach items="${status.errorMessages}" var="error">
                  				<c:out value="${error}"/>
                  			</c:forEach>
                  		</div>
                  	</c:if>
                </td>
                </spring:bind>
                </td>
           </tr>
           <tr>
            	<td align="right">Model:</td>
            	<spring:bind path="commandName.model">
            	<td>
            	<input type="text" 
            		   name="<c:out value='${status.expression}'/>"
                       value="<c:out value='${status.displayvalue}'/>"/>
                </td>
                <td>
                  	<c:if test="${status.error}">
                  		<div class="error">
                  			<font color="red">
                  			<c:forEach items="${status.errorMessages}" var="error">
                  				<c:out value="${error}"/>
                  			</c:forEach>
                  		</div>
                  	</c:if>
                </td>
                </spring:bind>
                </td>
           </tr>
           <tr>
            <td align="right">Frame:</td>
            	<spring:bind path="commandName.frame">
            	<td>
            	<input type="text" 
            		   name="<c:out value='${status.expression}'/>"
                       value="<c:out value='${status.displayvalue}'/>"/>
                </td>
                <td>
                  	<c:if test="${status.error}">
                  		<div class="error">
                  			<font color="red">
                  			<c:forEach items="${status.errorMessages}" var="error">
                  				<c:out value="${error}"/>
                  			</c:forEach>
                  		</div>
                  	</c:if>
                </td>
                </spring:bind>
                </td>
           </tr>
           <tr>
            <td align="right">Serial Number:</td>
            	<spring:bind path="commandName.serialNo">
            	<td>
            	<input type="text" 
            		   name="<c:out value='${status.expression}'/>"
                       value="<c:out value='${status.displayvalue}'/>"/>
                </td>
                <td>
                  	<c:if test="${status.error}">
                  		<div class="error">
                  			<font color="red">
                  			<c:forEach items="${status.errorMessages}" var="error">
                  				<c:out value="${error}"/>
                  			</c:forEach>
                  		</div>
                  	</c:if>
                </td>
                </spring:bind>
                </td>
           </tr>
           <tr>
            <td align="right">Weight:</td>
            	<spring:bind path="commandName.weight">
            	<td>
            	<input type="text" 
            		   name="<c:out value='${status.expression}'/>"
                       value="<c:out value='${status.displayvalue}'/>"/>
                </td>
                <td>
                  	<c:if test="${status.error}">
                  		<div class="error">
                  			<font color="red">
                  			<c:forEach items="${status.errorMessages}" var="error">
                  				<c:out value="${error}"/>
                  			</c:forEach>
                  		</div>
                  	</c:if>
                </td>
                </spring:bind>
                </td>
           </tr>
           <tr>
            <td align="right">Status:</td>
            	<spring:bind path="commandName.status">
            	<td>
            	<input type="text" 
            		   name="<c:out value='${status.expression}'/>"
                       value="<c:out value='${status.displayvalue}'/>"/>
                </td>
                <td>
                  	<c:if test="${status.error}">
                  		<div class="error">
                  			<font color="red">
                  			<c:forEach items="${status.errorMessages}" var="error">
                  				<c:out value="${error}"/>
                  			</c:forEach>
                  		</div>
                  	</c:if>
                </td>
                </spring:bind>
                </td>
           </tr>
         </table>
         <input type="submit" value="Submit">
     </form>
   </body>
</html>